<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8" />
	<title>Aplikasi Legalisir Online | Dinas Pendidikan Kota Surabaya</title>
	<meta name="description" content="app, web app, responsive, admin dashboard, admin, flat, flat ui, ui kit, off screen nav" />
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
	
	<link rel="stylesheet" href="<?php echo base_url();?>css/signup/bootstrap.css" type="text/css" />
	<link rel="stylesheet" href="<?php echo base_url();?>css/animate.css" type="text/css" />
	<link rel="stylesheet" href="<?php echo base_url();?>css/font-awesome.min.css" type="text/css" />
	<link rel="stylesheet" href="<?php echo base_url();?>css/font.css" type="text/css" cache="false" />
	<link rel="stylesheet" href="<?php echo base_url();?>css/plugin.css" type="text/css" />
	<link rel="stylesheet" href="<?php echo base_url();?>css/signup/app.css" type="text/css" />
	<link rel="shortcut icon" id="favicon" href="<?php echo base_url()?>images/favicon2.ico">
	<style>
	.loader{
		position:fixed;
		top:0;
		left:0;
		background:url('<?php echo base_url("images/loading.gif");?>') rgba(255,255,255,0.8) no-repeat 50%;
		height:100%;
		width:100%;
		z-index:900;
		overflow:hidden;
	}
	#recaptcha_response_field{
		height:22px;
	}
</style>
</head>
<body background="<?php echo base_url()?>images/signup/background2.jpg" marginheight="100%" marginwidth="100%" style="width:100%;height:100%;background-size:cover;background-repeat:no-repeat;background-position:center center;">
<section id="content" class="m-t-lg wrapper-md animated fadeInDown" >
	<div class="row m-n">
		<div class="col-md-4 col-md-offset-4 m-t-lg">
			<section class="panel">
			  <header class="panel-heading bg bg-primary text-center">
					Legalisir Online (Akun Baru)
				</header>
				<form data-parsley-validate="" action="<?php echo site_url('front/aktivasiLogin')?>" method="post" class="panel-body" id="signup" novalidate>
					<div class="form-group">
						<label class="control-label">Nama Lengkap</label>
						<input type="text" name="nama_lengkap" class="form-control" data-parsley-trigger="focusout" data-parsley-error-message="Nama wajib diisi." required data-parsley-id="8010"><ul class="parsley-errors-list" id="parsley-id-8010"></ul>
					</div>
					<div class="form-group">
						<label class="control-label">Email</label>
						<input type="email" id="email_address" name="email" data-parsley-trigger="focusout" data-parsley-error-message="Penulisan Email Salah" class="form-control" value="<?php echo set_value('email'); ?>" required data-parsley-id="1631"><ul class="parsley-errors-list" id="parsley-id-1631"></ul>
						<p><?php echo form_error("email"); ?></p>
					</div>
					<div class="form-group">
						<label class="control-label">Username</label>
						<input type="text" id="user_name" name="user_name" class="form-control" value="<?php echo set_value('user_name'); ?>" data-parsley-trigger="focusout" data-parsley-error-message="Username wajib diisi." required data-parsley-id="2291"><ul class="parsley-errors-list" id="parsley-id-2291"></ul>
						<p><?php echo form_error("user_name"); ?></p>
					</div>
					<div class="form-group">
						<label class="control-label">Password</label>
						<input type="password" id="password" name="password" class="form-control" value="<?php echo set_value('password'); ?>" data-parsley-trigger="focusout" data-parsley-error-message="Password wajib diisi." required data-parsley-id="9892"><ul class="parsley-errors-list" id="parsley-id-9892"></ul>
					</div>
					<div class="form-group">
						<label class="control-label">Konfirmasi Password</label>
						<input type="password" id="con_password" name="con_password" class="form-control" value="<?php echo set_value('con_password'); ?>" data-parsley-trigger="focusout" data-parsley-error-message="Konfirmasi password wajib diisi." required data-parsley-id="1106"><ul class="parsley-errors-list" id="parsley-id-1106"></ul>
						<input type="hidden" name="key" value="<?php echo md5("l3galisir" . date("Ydm")); ?>">
					</div>
				<button type="submit" class="btn btn-info" value="Submit"><i class="fa fa-pencil text"></i><span class="text"> Daftar</span></button>
				<div class="line line-dashed"></div>
				<p class="text-muted text-center"><small>Sudah terdaftar ?</small></p>
				<a href="http://localhost/legalisir_online/front/signin" class="btn btn-white btn-block"><i class="fa fa-sign-in text"></i><span class="text"> Sign in</span></a>
			  </form>
			</section>
		</div>
	</div>
</section>

<script src="<?php echo base_url();?>js/jquery.min.js"></script>
<script src="<?php echo base_url();?>js/bootstrap.js"></script>
<script src="<?php echo base_url();?>js/app.js"></script>
<script src="<?php echo base_url();?>js/app.plugin.js"></script>
<script src="<?php echo base_url();?>js/app.data.js"></script>
<script src="<?php echo base_url();?>js/parsley/parsley.min.js"></script>
<script src="<?php echo base_url();?>js/parsley/parsley.extend.js" cache="false"></script>
<script language="javascript">
	$("#signup").submit(function(){
		var cpwd= $("input[name='con_password']").val();
		var pwd	= $("input[name='password']").val();
		var res	= {
			loader:$('<div />', {class: 'loader'}),
			maincol: $('body')
		}
		$.ajax({
		   type: "POST",
		   data: $("#signup").serialize(),
		   url:"<?php echo base_url();?>front/aktivasiLogin",
		   beforeSend:function(){
			res.maincol.append(res.loader);
		   },
		   success: function(data)
		   {
			if(data == "success"){
					$.ajax({
					   type: "POST",
					   url:"http://yeavirtual.com/index.php/mapi/",
					   data:$("#signup").serialize(),
					   async:false,
					   success: function(data)
					   {	
							res.maincol.find(res.loader).remove();
							alert("Selamat!!!\nPendaftaran anda berhasil dilakukan, silahkan cek email anda untuk informasi lebih lanjut.");
							document.location = "<?php echo base_url();?>";
					   },
					   error : function(data){
							res.maincol.find(res.loader).remove();
							alert("Selamat!!!\nPendaftaran anda berhasil dilakukan, silahkan cek email anda untuk informasi lebih lanjut.");
							document.location = "<?php echo base_url();?>";
					   }
					 });
			 } else {
				alert("Email atau username sudah terdaftar. Jika anda sudah terdaftar sebelumnya silahkan login. Apabila anda lupa password anda, silahkan kirim permintaan ubah password dengan menekan tombol lupa password yang ada di halaman login.");
				res.maincol.find(res.loader).remove();
			 }
		   },
		   error : function(data){
				alert("Pendaftaran gagal dilakukan.\nSilahkan hubungi administrator.");
				res.maincol.find(res.loader).remove();
		   }
		 });
		return false;
	});
</script>

</body>
</html>